#include "roundhandler.h"
#include <QBrush>
#include <QPen>

RoundHandler::RoundHandler():
    QGraphicsEllipseItem(-10, -10, 10, 10)
{
    setFlag(QGraphicsItem::ItemIsMovable);
    setFlag(ItemSendsGeometryChanges);
    setBrush(QBrush(QColor("darkgray")));
    setPen(QPen(QBrush(QColor("grey")), 2, Qt::SolidLine));
}

QVariant RoundHandler::itemChange(GraphicsItemChange change, const QVariant &value)
{

    qDebug("---->");

    if (change == ItemPositionChange && scene())
    {
        emit setCoordinates(value.toPointF());
    }

    return QGraphicsItem::itemChange(change, value);
}

RoundHandler::~RoundHandler()
{

}
